package com.huashi.dealer.modular.business.balance.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.huashi.dealer.enums.user.balanceLog.Scene;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @ClassName BalanceVo
 * @Description 余额列表返回参数
 * @Author 谭陈强
 * @Date 2025/8/15 13:36
 */
@Data
@Schema(description = "余额列表返回参数")
public class BalanceVo {
    
    @Schema(description = "记录ID", example = "1")
    private Long id;

    @Schema(description = "userID", example = "1")
    private Long userId;

    @Schema(description = "用户名称", example = "张三")
    private String name;
    
    @Schema(description = "用户ID", example = "1001")
    private Integer userName;
    
    @Schema(description = "场景类型", example = "1")
    private Integer scene;
    
    @Schema(description = "场景类型文本", example = "充值")
    private String sceneText;
    
    @Schema(description = "金额", example = "100.00")
    private BigDecimal money;
    
    @Schema(description = "描述", example = "用户充值")
    private String description;
    
    @Schema(description = "备注", example = "管理员操作")
    private String remark;
    
    @Schema(description = "创建时间", example = "2025-08-15 13:36:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    public void setScene(Integer scene) {
        this.scene = scene;
        Scene sceneEnum = Scene.getByValue(scene);
        this.sceneText=sceneEnum != null ? sceneEnum.getName() : "未知场景";
    }
}